package com.fh;/**
 * 描述:
 * Author:袁亚强
 * Date:2021/12/1416:38
 */

import java.io.FileWriter;
import java.io.IOException;
import java.util.UUID;

/**
 * created by macro on 2021/12/14,
 */
public class Esecutor implements Runnable{
    @Override
    public void run() {
        createFile();

    }

    public static void createFile() {
        try {
            // 睡眠1000毫秒=1秒，目的就是为了让大家看到创建文件的过程
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        FileWriter fw = null;
        try {
            fw = new FileWriter("e:/info/" + UUID.randomUUID() + ".txt");
            fw.write("xxxxxxx");
            fw.flush();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (fw != null) {
                try {
                    fw.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
